<template>
    <el-row style="padding:10px 20px;" class="stationWrap">
        <el-breadcrumb separator-class="el-icon-arrow-right" style="margin-bottom:10px;">
          <el-breadcrumb-item><img style="width: 16px;vertical-align: middle;margin-right: 5px" src="@/assets/indexPage/location.png"/> 诊断结果</el-breadcrumb-item>
          <el-breadcrumb-item>诊断结果分析</el-breadcrumb-item>
          <el-breadcrumb-item>
            <span style="font-weight:600;">
               {{ activeName }}
            </span>
          </el-breadcrumb-item>
        </el-breadcrumb>
        <el-tabs type="border-card" v-model="activeName" @tab-click="handleClick">
          <el-tab-pane label="按场站查询" name="按场站查询">
           <station ref="station" />
          </el-tab-pane>
          <el-tab-pane label="按组件查询" name="按组件查询">
           <pvModule ref="pvModule" />
          </el-tab-pane>
        </el-tabs>
    </el-row>
</template>

<script>
  import pvModule from "./pvModule"
  import station from "./stations"
  export default {
    name: "stationWrap",
    components: {
      pvModule,
      station
    },
    data() {
      return {
        activeName: "按场站查询"
      }
    },
    mounted() {
      let query = this.$route.query
      if (query && query.type) {
        this.activeName = query.type
        if (query.type === '按组件查询') {
          this.$refs.pvModule.tick()
        }
      }
    },
    methods: {
      handleClick(value) {
        if (value.label === '按组件查询') {
          this.$refs.pvModule.tick()
        } else {
          this.$refs.station.tick()
        }
      }
    }
  }
</script>

<style lang="scss">
  .stationWrap{
    .is-active{
      box-shadow: 0px 0px 10px 0px rgba(55,64,94,0.3);
    }
    .el-tabs--border-card>.el-tabs__header .el-tabs__item{
      border: 1px solid #E4E7ED;
    }
  }
</style>
